Building Better PowerShell Code by Adam Bertram

Building Better PowerShell Code by Adam Bertram

Author:Adam Bertram
Language: eng
Format: epub
ISBN: 9781484263884
Publisher: Apress


Further Learning

When You Should Use PowerShell Aliases

Put Functions in Alphabetical Order in a Module

If you have a module file (PSM1) with many different functions, consider defining them in alphabetical order. If you have a module with dozens of functions, you should make it as easy as possible to find a function. One way to do that is through alphabetical ordering.

Alphabetical ordering will come in handy too when you’re working in an editor like Visual Studio (VS) Code. In many editors, you can bring up a list of all functions defined in a file. In VS Code, you can type Ctrl-Shift-O while you have a module file open and you’ll immediately see all of the functions defined in that file. If all functions were in alphabetical order, you can quickly scan through the list to find the function you’re looking for.

Figure 10-1Viewing functions in Visual Studio Code



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.